import { setup } from '@css-render/vue3-ssr'
import { defineNuxtPlugin } from 'nuxt/app'

export default defineNuxtPlugin((nuxtApp) => {
    if (process.server) {
        const { collect } = setup(nuxtApp.vueApp)
        nuxtApp.hooks.hook('app:rendered', () => {
            nuxtApp.payload.cssRender = collect()
        })
    }
})